<%--
 *  File:    NotesEdit.jsp
 *  @Author: Vector mao
 *  Date:    2/19/2002 13:45
 *
 *  Copyright (C) 2000 - 2002 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.foundation.DefaultParams" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  	Category cat = Category.getInstance("jsp.NotesEdit");
  	//init param
  	String strModuleName = "BIEE";
	String privilegeCode = "Z0402,L301";
    String contextPath = request.getContextPath();
%>



<%
  	HashMap userInfo = (HashMap)session.getAttribute("userinfo");
%>
<%@ include file="/inc/PageDefault.inc" %>
<%int LangNums = ConstantProp.multiLangNumber;%>
<html>

<head>
<title>NotesEdit</title>
<PageFlow:CheckPageFlow pageName="p_distributortenderattachment"/>
<%@ include file="/inc/InitEdit.inc" %>

<%
	HashMap myhash = null;

	Vector newpictures = null;
	Vector content = null;
    Vector groupvector = null;

	myhash = (HashMap)pageContext.getAttribute("pubnotesinfo");
	newpictures = (Vector)pageContext.getAttribute("newpictures");
	content = (Vector)pageContext.getAttribute("content");
  groupvector = (Vector)pageContext.getAttribute("groupvector");


  if (newpictures == null)
    newpictures = new Vector();
  
  if (content == null)
    content = new Vector();
  if(groupvector==null)
	  groupvector = new Vector();
  if (newpictures == null)
    newpictures = new Vector();
  if (content == null)
    content = new Vector();

  String disnoteid = new String("");
  String title = new String("");
  String ispublic = "";
  String begindate = "";
  String enddate = "";
  String userid =  ""+userInfo.get("userid");


 	Integer nContentId0 = null;
  Integer nContentId1 = null;
  Integer nContentId2 = null;
  Integer nContentId3 = null;
  String titlecn = "";
  String titleen = "";
  String contentcn = "";
  String contenten = "";
 int isnewflag = -1;


	if(myhash == null)
	{
  	myhash = new HashMap();
  	
	  GregorianCalendar aDate = new GregorianCalendar();
	  String year = ""+aDate.get(Calendar.YEAR);
	  String month = aDate.get(Calendar.MONTH)>8?""+(aDate.get(Calendar.MONTH)+1):"0"+(aDate.get(Calendar.MONTH)+1);
	  String day = aDate.get(Calendar.DAY_OF_MONTH)>9?""+aDate.get(Calendar.DAY_OF_MONTH):"0"+aDate.get(Calendar.DAY_OF_MONTH);
	}
	else
	{
	  if ((myhash.get("disnoteid"))!=null)
	  {
	    disnoteid = (myhash.get("disnoteid")).toString();
	    userid = (myhash.get("userid")==null ? "" : (myhash.get("userid")).toString());
        isnewflag = 1;
      }
    ispublic = (myhash.get("ispublic")==null ? "N" : (myhash.get("ispublic")).toString());
    enddate = (myhash.get("enddate")==null ? "" : (myhash.get("enddate")).toString());
	}

     String viewflag = "";

     if(pageContext.getAttribute("viewflag") != null&&((String)pageContext.getAttribute("viewflag")).equals("view")) {

           viewflag = "view";
     }
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js">
</script>
<script language="JavaScript" src="<%=contextPath%>/js/FuncLib.js">
</script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js">
</script>
<script>
function page_done()
{  
	
	 if(getLength(cform.title.value)>128)
	 {
      alert("<%= message.getMessageDesc("LENGTH_MUST_LESSTHAN",label.getLabelName("L_TitleCN",false),"128") %>");
	    return;
	 }
	 
	  //if(!isNumber(cform.defaultexpiredays.value))
	  //{
      //alert("<%= message.getMessageDesc("VALUE_MUST_BE_POS_INT",label.getLabelName("L_EffectiveDay",false)) %>");
	    //return;
	  //}
	  if(!checkNull(document.cform)) return;
	  
    //if(document.cform.ispublic0.checked == true)
      //document.cform.ispublic.value = "Y";
    //else
     // document.cform.ispublic.value = "N";
     
     
    //var opts = cform.picturenames.options;
    //var hiddenpname = "";
    //if (opts!=null)
    //for (var i = 0 ; i<opts.length;i++)
     // hiddenpname += "<input type=hidden name=newpictures value="+opts[i].value +">";
    //hide.innerHTML = hiddenpname;
    //MLCSTransform(document.cform);
    
    emptyToNull(document.cform);  
  	document.cform.actionname.value = "done";
  	document.cform.target = "_parent";
  	isRunning = true;
  	document.cform.submit();
  	window.close();
}


function choosepublic()
{
 if (document.cform.ispublic.value == "Y")
 {
   document.cform.ispublic.value = "N";
 }else
 {
   document.cform.ispublic.value = "Y";
 }
}
   
function deloption()
{
    var opts = cform.picturenames.options;
    if (opts!=null)
    for (var i = opts.length-1 ; i>=0;i--)
    {
      if (opts[i].selected == true)
        opts.remove (i);
    }

}
function page_operate(operand)
{
    if (operand=='addpic')
    {
      var pname = ""+cform.picture.value;
      if (pname=="")
        return;
      /*if(!allIsEnglish(cform.picture.value))
      {
        alert("<%= message.getMessageDesc("MUST_BE_EN",label.getLabelName("L_Maccessory",false) + label.getLabelName("L_Name",false)) %>");        
        return;
      }
      if(!allIsEnglish(cform.picturename.value))
      {
        alert("<%= message.getMessageDesc("MUST_BE_EN",label.getLabelName("L_Maccessory",false) + label.getLabelName("L_Name",false)) %>");
        return;
      }*/
      var re = /.txt$|.doc$|.docx$|.xls$|.xlsx$|.vsd$|.pdf$|.ppt$|.zip$|.rar$|.bmp$|.jpg$|.jpeg$|.tiff$|.gif$|.pcx$|.tga$|.exif$|.fpx$|.svg$|.psd$|.cdr$|.pcd$|.dxf$|.ufo$|.eps$|.ai$|.raw$/ig;
      if(pname.toUpperCase().match(re) == null)
      {
        alert("<%= message.getMessageDesc("ILLEGAL_FORMAT",label.getLabelName("L_Maccessory",false)) %>");
        return;
      }  
      if (pname.indexOf("\\")!=-1)
        pname = pname.substring(pname.lastIndexOf("\\")+1,pname.length);
      if (cform.picturename.value=="")
        cform.picturename.value = pname;
      if(cform.picturename.value.toUpperCase().match(re) == null)
      {
        if(pname.lastIndexOf(".") != -1)
          cform.picturename.value += pname.substring(pname.lastIndexOf("."));
        <%--[SCRIPT]  alert("<#%= message.getMessageDesc("ILLEGAL_FORMAT",label.getLabelName("L_Picture",false)) %#>");  [SCRIPT]--%>
        <%--[SCRIPT]  return;  [SCRIPT]--%>
      }  

      if (getLength(cform.picturename.value)>64)
      {
		    alert("<%= message.getMessageDesc("LENGTH_MUST_NOT_EQUAL", label.getLabelName("L_Name",false),"64") %>" );
		    return;
      }
    }
  
  	cform.actionname.value = operand;
  	cform.target = "_self";
  	isRunning = true;
  	cform.submit();

}
var popwindow;
function page_mulilang(name,label,num,need)
{
  var disnoteid=document.cform.disnoteid.value;
  if(popwindow!=null)
    popwindow.close();
  var strurl="<%=contextPath%>/common/Lang.jsp?<%= OvalTools.randomURL() %>&form=cform&module=BIEE&mlctype="+label+"&nativelanguage="+need+"&schema=ovnoteslang&entityid="+disnoteid+"&entitytype="+name+"&contentid=noteslangid&colindex="+num;
  var strStatus= "height=250, width=250,top=100,left=100,toolbar=n0, menubar=no, scrollbars=no, resizable=no, location=no, status=no";
  popwindow=window.open(strurl, "newwindow",strStatus);
}

function selectFile()
{
  var val = cform.picture.value;
  var fn = val.substring(val.lastIndexOf('\\')+1,val.length);
  if(fn.length == val.length)
    fn = val.substring(val.lastIndexOf('\/')+1,val.length);
  cform.picturename.value=fn;
}

function page_delete(){

	if(isEmpty(document.cform.dispictureids.value) || document.cform.dispictureids.value == -1)
	{
		return;
	}
    if(!confirm("<%= message.getMessageDesc("ARE_YOU_SURE_DEL") %>")) return;
    
    cform.actionname.value = "delete";
    cform.target = "_self";
    isRunning = true;
	cform.submit();
}


function clickRow(id)
{
  document.cform.dispictureids.value = id;
}


function page_download(savefilename,filename){
	document.cform.filename.value=filename;
	document.cform.savefilename.value=savefilename;
	//alert(document.cform.filename.value);
	//alert(document.cform.savefilename.value);
	cform.actionname.value = "download";
	cform.target = "_self";
	//isRunning = true;
	cform.submit();
}

</script>
</head>
<body>

	<%--------------------------------------  hidden form variant   --%>
	<form name="cform" method="post" action="<%=contextPath%>/Dispatcher" ENCTYPE="multipart/form-data">
    <input type="hidden" name="pagename" value="p_distributortenderattachment">
    <input type="hidden" name="actionname">
    <custom:hidden property="filename"/>
	<custom:hidden property="savefilename"/>
    <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
    <custom:hidden property="distributortenderid" />
    <custom:hidden property="disnoteid" />
     <custom:hidden property="viewflag" />
    <input type="hidden" name="disnoteid" value="<%=JspHelper.filterNull( disnoteid )%>">
    <input type="hidden" name="status" value="10">
	  <input type="hidden" name="grade" value="1">
    <input type="hidden" name="fromuserid" value="<%=JspHelper.filterNull( userid )%>">
	  <input type="hidden" name="subjectcode" value="301">
	  <%if ((myhash.get("disnoteid"))==null){%>
	  <input type="hidden" name="begindate" value="<%=OvalTools.getDate("yyyy-MM-dd HH:mm:ss")%>">
	  <%} else {%>
	  <input type="hidden" name="begindate" value="<%= OvalTools.dateToString((java.util.Date)myhash.get("begindate"), "yyyy-MM-dd HH:mm:ss")%>">
      <%}%>
   	<input type="hidden" name="entityid" value="<%=JspHelper.filterNull( disnoteid )%>">
    <input type="hidden" name="entitytype" value="N">
   	<input type="hidden" name="entityid0" value="<%=JspHelper.filterNull( disnoteid )%>">
   	<input type="hidden" name="entityid1" value="<%=JspHelper.filterNull( disnoteid )%>">
   	<input type="hidden" name="entityid2" value="<%=JspHelper.filterNull( disnoteid )%>">
   	<input type="hidden" name="entityid3" value="<%=JspHelper.filterNull( disnoteid )%>">
   	<%if (newpictures.size()>4)
   	for (int i=4;i<newpictures.size();i++){
   	%>
   	<input type="hidden" name="entityid<%=JspHelper.filterNull(i)%>" value="<%=JspHelper.filterNull( disnoteid )%>">
   	<%}%>
   	<%int i=0;%>
    <logic:iterate id="ps" collection="<%= newpictures %>" indexId="orderId">
    <%HashMap psMap = (HashMap)ps;
    //System.out.println(psMap);
    if (psMap!=null&&psMap.get("picturename")!=null){
    %>
   	<input type="hidden" name="pictureid<%=JspHelper.filterNull(i)%>" value="<%=JspHelper.filterNull( psMap.get("pictureid") )%>">
   	<input type="hidden" name="picturename<%=JspHelper.filterNull(i)%>" value="<%=JspHelper.filterNull( psMap.get("picturename") )%>">
   	<input type="hidden" name="dispictureid<%=JspHelper.filterNull(i)%>" value="<%=JspHelper.filterNull( psMap.get("dispictureid") )%>">
   	<%++i;}%>
    </logic:iterate>


    <input type="hidden" name="entitytype0" value="NT">
    <input type="hidden" name="entitytype1" value="NT">
    <input type="hidden" name="entitytype2" value="NC">
    <input type="hidden" name="entitytype3" value="NC">
    <%if(newpictures.size()>0){ %>
    <input type="hidden" name="numrows" value="<%=newpictures.size() %>">
    <%}else{ %>
    <input type="hidden" name="numrows" value="<%=LangNums %>">
    <%} %>
    
<table width="100%" cellspacing="0" border="0" cellpadding="0">

  <tr>
    <td class="summary_top"></td>
  </tr>
  <tr>
    <td>
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
        	<%
          		String strTextTypeCN = "td-text";
          		String strTextTypeEN = "td-text";
          		String strNullCN = "Y";
          		String strNullEN = "Y";
          		if(strLanguageCode.equalsIgnoreCase("cn"))
          		{
            		strTextTypeCN = "need";
            		strNullCN = "N";
            	}
          		if(strLanguageCode.equalsIgnoreCase("en"))
          		{
            		strTextTypeEN = "need";            
            		strNullEN = "N";
            	}
        	%>

        <!--<tr>
          <td class="<%=JspHelper.filterNull( strTextTypeCN )%>" width="90"><%= label.getLabelName("L_TitleCN") %><%= label.getLabelName("L_Colon") %></td>
          <td colspan="3">
            
            <custom:text name="pubnotesinfo" property="title" size="122" module="BIEE" label="L_TitleCN" needMLC="true" isFirstMLC="true"  multiLangType="nt" entityId="disnoteid" contentId="noteslangid" colIndex="0"/>
	          <a onclick="page_mulilang('nt','L_TitleCN',0,'');"><custom:button type="3" label="L_Ln" imgsrc="ln.gif" border="0"/></a> 
          </td>
        </tr>
        
        <tr>
          <td class="<%=JspHelper.filterNull( strTextTypeCN )%>"><%= label.getLabelName("L_ContentCN") %><%= label.getLabelName("L_Colon") %></td>
          <td colspan="3">
            
            <custom:textarea name="pubnotesinfo" property="content" cols="90" rows="3" module="BIEE" label="L_ContentCN" needMLC="true"  multiLangType="nc" entityId="disnoteid" contentId="noteslangid" colIndex="0"/>
	          <a onclick="page_mulilang('nc','L_ContentCN',0,'');"><custom:button type="3" label="L_Ln" imgsrc="ln.gif" border="0"/></a> 
          </td>
        </tr>
        

         <tr>
          <td class="td-text" ><%= label.getLabelName("L_EffectiveDay") %><%= label.getLabelName("L_Colon") %></td>
          <td colspan="3">
          <% int defaultexpireday = 7;
             if ( pageContext.getAttribute("defaultexpiredays") instanceof Double)
                 defaultexpireday =  ((Double)pageContext.getAttribute("defaultexpiredays")).intValue();
             else if ( pageContext.getAttribute("defaultexpiredays") instanceof Integer)
                 defaultexpireday =  ((Integer)pageContext.getAttribute("defaultexpiredays")).intValue();
           %>
            <input type=text name="defaultexpiredays" value="<%=JspHelper.filterNull(defaultexpireday)%>" size="20">
          </td>
          <td style="display: none;" class="td-text"><%= label.getLabelName("L_IsOpen") %><%= label.getLabelName("L_Colon") %></td>
          <td style="display: none;">
            <input type="checkbox" name="ispublic0" value="" <%if(ispublic!=null&&ispublic.equalsIgnoreCase("Y")){%>checked<%}%> class="normalradio" onclick="choosepublic()">
            <input type="hidden" name="ispublic" value="<%if(ispublic!=null&&ispublic.equalsIgnoreCase("Y")){%>Y<%} else{%>N<%}%>">
          </td>
        </tr>
     <tr>
    <td class="td-text" ><%= label.getLabelName("L_News") %><%= label.getLabelName("L_Type") %><%= label.getLabelName("L_Colon") %></td>
    <td colspan="3"><custom:selectdic dictType="NotesType" property="notestype" name="pubnotesinfo"  defaultValue="------" /> </td>
      </tr>
    <tr>
    <td class="td-text" ><%= label.getLabelName("L_JOBTITLE") %><%= label.getLabelName("L_Type") %><%= label.getLabelName("L_Colon") %></td>
    <td colspan="3"><custom:select optionInnerTextKey="usergroupname" optionsName="groupvector" property="usergroupid" name="pubnotesinfo"  defaultValue="-------------" optionValueKey="usergroupid"/> </td>
    </tr>-->
    <%if(!viewflag.equals("view")){%>
        <tr>
          <td class="td-text" rowspan="2"><%= label.getLabelName("L_Maccessory") %><%= label.getLabelName("L_Colon") %></td>
          <td colspan="2">
          
          
	          <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellpadding="0" width="100%">
		          <tr class="deepblue-left">
		            <td width="2%" class="title_center">&nbsp;</td> 
					<td width="40%" class="title_center"><%= label.getLabelName("L_filename") %></td>           
          			<td width="15%" class="title_center"><%= label.getLabelName("L_accessory ")+label.getLabelName("L_Upload ")+ label.getLabelName("L_Time ")%></td>
          			<td width="15%" class="title_center"><%= label.getLabelName("L_UploadMan") %></td>
          			<td width="12%" class="title_center" ><%= label.getLabelName("L_AttachName")%></td>
		          </tr>
		          
		        <%
		        
		             String strClassType = new String("");   
		             Integer nDefaultId = null;             
		             Integer nDefaultStatus = null;
		             Integer nDefaultVersion = new Integer(-1);
		             int ii=0;
		             String strChecked = "";
		             boolean bHasChecked = false;
          		%>   
	          <logic:iterate id="ps" collection="<%= newpictures %>" indexId="orderid">
	          <%
	          	HashMap psMap = (HashMap)pageContext.getAttribute("ps");
	            if(ii%2 == 1)
	            {
	              strClassType = "td-listrom";
	            }else{                    
	              strClassType = "none";
	            }
	            if(!bHasChecked)
	            {
	              bHasChecked = true;
	              strChecked = "Checked";
	              nDefaultId = (Integer)((HashMap)pageContext.getAttribute("ps")).get("dispictureid");
	            }
	            else
	            {
	              strChecked = "";
	            }
	            ii++;
	            
	            
	            
		         
		         
		         
                //HashMap psMap = (HashMap)picture;
		         String regEx= "/.doc$|.pdf$|.ppt$|.txt$|.xls$|.gif$|.bmp$|.jpg$|.jpeg$/ig";
		         String str="";
		         String ContextPath=request.getContextPath();
		         String strFileDir=DefaultParams.findParam("uploadfilepath");

		         String downloadstr ="";
		         if(strFileDir!=null){
		        	strFileDir=strFileDir+psMap.get("picturename");
                      // downloadstr = "../DownLoadCadbury.jsp?downloadpath="
                     //    +java.net.URLEncoder.encode(strFileDir,"UTF-8")
			           //  +"&filename="
			            // +java.net.URLEncoder.encode((String)psMap.get("picturename"),"UTF-8")
                      //   +"&truefilename="
                      //   +java.net.URLEncoder.encode((String)psMap.get("picturename"),"UTF-8");
                }
	            
	          %>            
	          <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'"  onClick="radiotrue('dispictureid<%=JspHelper.filterNull( ii )%>');
				    javascript:clickRow('<oval:write name="ps" property="dispictureid" />');" class="<%=JspHelper.filterNull( strClassType )%>"> 
	            <td> 
	              <input <%=JspHelper.filterNull( strChecked )%> id="dispictureid<%=JspHelper.filterNull( ii )%>" type="radio" name="order" value="<oval:write name="ps" property="dispictureid"/>" class="normalradio"/>
	            </td>       
	            <td><custom:write name="ps" property="picturename" nbsp="true"/></td>
	            <td><custom:write name ="ps" property="uploaddate" nbsp="true"/></td>
	            <td><custom:write name="ps" property="username" nbsp="true"/></td>
	            <td><a onclick="page_download('<%= java.net.URLEncoder.encode((String)psMap.get("picturename"),"UTF-8") %>','<%=strFileDir %>')"><custom:button type="1" label="L_Download" imgsrc="edit.gif" border="0" style="width:60"/></a>
	            

	          </tr>
	          </logic:iterate> 
	          <input type="hidden" name="dispictureids" value="<%=JspHelper.filterNull( nDefaultId )%>">
	          <tr><td colspan="5">
            	<a onclick="page_operate('delpic')"><custom:button type="1" label="L_Clear" imgsrc="delete.gif" border="0" style="width:60"/></a>
            	<a onclick="page_delete()"><custom:button type="1" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
	          </td></tr>
	          
	          </table>

          
          
          
          
          
          
          
          
          
          
          
          </td>
          
          
          
          
          
          
          

        
        
        
        
        
        
        
          
          
          <td colspan="5">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>
                    <%= label.getLabelName("L_Name") %><%= label.getLabelName("L_Colon") %>
                  <input type="text" name="picturename" size="10">&nbsp;<%= label.getLabelName("L_Path") %><%= label.getLabelName("L_Colon") %><input type="file" name="picture" onclick="javascript:picture.focus()" onfocus="javascript:selectFile()" size="12">
                </td>
                <td><a onclick="page_operate('addpic')"><custom:button type="1" label="L_Upload" imgsrc="Upload.gif" border="0" style="width:60"/></a>
                    &nbsp;
                </td>
              </tr>
            </table>
          </td>
          
          
          
          
          
          
          
        </tr>
     <%}else{%>

          <!--<tr>
          <td class="td-text"  ><%= label.getLabelName("L_Maccessory") %><%= label.getLabelName("L_Colon") %></td>
          <td width="100" rowspan="2" style="line-height: 50%">
            <select name="picturenames" size="5" multiple>
              <logic:iterate id="ps" collection="<%= newpictures %>" indexId="orderId">
					    <%HashMap psMap = (HashMap)ps;
					    if (psMap!=null&&psMap.get("picturename")!=null){
					    %>
              <option value="<%=JspHelper.filterNull( psMap.get("picturename") )%>"><%=JspHelper.filterNull( psMap.get("picturename") )%></option>
              <%}%>
              </logic:iterate>
            </select>
            <br><br>

          </td>

        </tr>-->
           <tr class="deepblue-left">
                                                	<td class="title_center" width="8%"><%= label.getLabelName("L_Seq")%></td>
                                                    <td class="title_center" ><a href="javascript:page_summary('orderby','picturename')"><%= label.getLabelName("L_AttachName")%></a></td>
                                                </tr>
                                                   <%
                                                      Vector pictures = (Vector)pageContext.getAttribute("pictures");
                                                      if(pictures == null)
                                                      {
                                                    	  pictures = new Vector();
                                                      }
                                                      String strClassType = "";
                                                      int j=0;
                                                      String strIsChecked = new String("Checked");
                                                      
                                                   %>
                                                   <logic:iterate id="picture" collection="<%= newpictures %>">
                                                   <%

                                                     if(j%2 == 1)
                                                     {
                                                       strClassType = "td-listrom";
                                                     }else{
                                                       strClassType = "none";
                                                     }
                                                     j++;

                                                     HashMap psMap = (HashMap)picture;
                         					         String regEx= "/.doc$|.docx$|.xlsx$|.pdf$|.ppt$|.pptx$|.txt$|.xls$|.gif$|.bmp$|.jpg$|.jpeg$/ig";
                         					         String str="";
                         					         //String ContextPath=request.getContextPath();
                         					         String strFileDir=DefaultParams.findParam("uploadfilepath");

                         					         String downloadstr ="";
                         					         if(strFileDir!=null){
                                                            downloadstr = contextPath+"/DownLoadCadbury.jsp?downloadpath="
                                                              +java.net.URLEncoder.encode(strFileDir,"UTF-8")
                         						             +"&filename="
                         						             +java.net.URLEncoder.encode((String)psMap.get("picturename"),"UTF-8")
                                                              +"&truefilename="
                                                              +java.net.URLEncoder.encode((String)psMap.get("picturename"),"UTF-8");
                                                      }
                                                   %>
                                                   	 <tr>
                                                        <td class="title_center">&nbsp;<%= j %></td>
                                                        <td class="title_center">&nbsp;<a href="<%= downloadstr %>"><%= psMap.get("picturename") %> &nbsp;<%= psMap.get("username") %> &nbsp;<%= psMap.get("uploaddate") %></a></td>
                                                      </tr>
                                                    </logic:iterate>


     <%}%>
      </table>
    </td>
  </tr>
  <tr>
    <td class="summary_top"></td>
  
  </tr>
  <tr>
    <td class="td_center"><a onclick="page_done()"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60"/></a>
    <a onclick="page_close();"><custom:button type="1" label="L_Close" imgsrc="close.gif" border="0" style="width:60"/></a></td>
  </tr>
</table>
</body>
<span id=hide></span>
</form>
<script language="JavaScript">
<%if(isnewflag==1){ %>
document.cform.picturename.value = "";
document.cform.picture.value = "";
 <%}%>
</script>
</html>


